//
//  YTSelecteWithdrawViewController.m
//  YiTuDriverClient
//
//  Created by 石少庸 on 2017/5/26.
//  Copyright © 2017年 Yitu. All rights reserved.
//

#import "YTSelecteWithdrawViewController.h"
#import "YTAddWithdrawAccountViewController.h"

@interface YTSelecteWithdrawViewController ()

@end

@implementation YTSelecteWithdrawViewController

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    [self performSegueWithIdentifier:@"YTAddWithdrawAccount" sender:RACTuplePack(cell.textLabel.text, @(indexPath.row + 1))];
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.identifier isEqualToString:@"YTAddWithdrawAccount"]) {
        YTAddWithdrawAccountViewController *addAcount = segue.destinationViewController;
        RACTuple *data = sender;
        addAcount.account = [NSString stringWithFormat:@"%@", data.first];
        addAcount.type = [NSString stringWithFormat:@"%@", data.second];
    }
}

@end
